package meng.spring.test21.aspectj;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class MyAspectJ {

	@Pointcut("execution(* meng.spring.test21.aspectj.*Service.*(..))")
	public void pointcut1() {
		// 返回值必须为void
	}

	@Pointcut("within(meng.spring.test21..*Service.*(..))")
	public void pointcut2() {
	}

	@Pointcut("public * (..)")
	public void pointcut3() {
	}

	/**
	 * && || !
	 */
	@Pointcut("pointcut1() && pointcut3()")
	public void pointcutCombination() {
		// 组合切入点
	}

	@Before("pointcut1()")
	public void beforeAdvie() {
		System.out.println("beforeAdvie");
	}

}
